package metrics;


import java.util.List;
import agents.Agent;

/**
 * The average fulfillment of the agents' quota.
 */

public class QuotaFulfillment extends AgentMetric {

	
	public QuotaFulfillment(List<Agent> agents){
		super(agents);		
	}
	
	@Override
	protected double computeScore() {
		double result = 0d;
		
		for(Agent x:agents)
			result += x.getUAP().percentage;
		
		result /= agents.size();
		result *= 100d;
		
		return result;
	}
	
	public String toString(){
		String result = "@ Quota Fulfillment: " + computeScore() + "%";
		return result;
	}

}
